package com.sun.module_mine.utils;

import android.content.Context;

import androidx.biometric.BiometricManager;

/**
 * @author:sunc
 * @time :2025/8/14 11:31
 * @desc: 描述 指纹验证
 */
public class BiometricUtils {
    public static boolean isBiometricReady(Context context) {
        BiometricManager manager = BiometricManager.from(context);
        switch (manager.canAuthenticate(
                BiometricManager.Authenticators.BIOMETRIC_STRONG)) {
            case BiometricManager.BIOMETRIC_SUCCESS:
                return true;
            case BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE:
            case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE:
            case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED:
            default:
                return false;
        }
    }
}
